<template>
  <el-dialog
    class="whisper_dialog"
    :model-value="modelValue"
    title="禁言名单"
    style="width: 300px; height: auto !important"
    draggable
    :modal="false"
    :append-to-body="true"
    show
    @update:model-value="handleClose"
  >
    <template #header="{ close, titleId, titleClass }">
      <div class="custom_header">
        <span>禁言列表</span>
      </div>
    </template>
    <div class="flex_out">
      <!-- <div class="flex_inner">
        <div class="flex_date">
          <span>总收益</span>
          <span>11111111</span>
        </div>
        <div class="flex_date">
          <span>总人数</span>
          <span>111111111</span>
        </div>
      </div> -->
      <div class="search_div">
        <el-input placeholder="搜索昵称ID" style="width: 150px; margin-left: 16px"></el-input>
        <el-button type="danger" size="mini" style="float: right; margin-right: 16px">
          全部移除
        </el-button>
      </div>
      <el-scrollbar height="400px" style="width: 100%">
        <ul class="infinite-list">
          <li v-for="i in count" :key="i" class="infinite-list-item">
            <div class="li_item">
              <!-- {{ i }} -->
              <div style="display: flex; flex-direction: row; justify-content: center">
                <img
                  src="https://axure-file.lanhuapp.com/md5__862eb7a7eeb6b7490153498e634cb182.jpg"
                  alt=""
                  srcset=""
                />
                <div
                  style="
                    display: flex;
                    flex-direction: column;
                    margin-left: 8px;
                    align-items: flex-start;
                  "
                >
                  <span class="name_span">用户昵称</span>
                  <div>
                    <span class="id_name">ID</span>
                    <span class="id_name">132489489456</span>
                  </div>
                </div>
              </div>
              <div>
                <el-button type="danger" size="mini">移除</el-button>
              </div>
            </div>
          </li>
        </ul>
      </el-scrollbar>
    </div>

    <!-- <template #footer>
      <el-button @click="handleClose">关闭</el-button>
    </template> -->
  </el-dialog>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

defineProps({
  modelValue: {
    // 接收父组件v-model传值
    type: Boolean,
    default: false,
  },
});
const count = ref(10);
const emit = defineEmits(["update:modelValue"]);

// 关闭对话框时通知父组件更新状态
const handleClose = () => {
  emit("update:modelValue", false);
};
</script>
<style lang="scss">
.whisper_dialog {
  padding: 0;
  background-color: #222222;

  .custom_header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: flex-start;
    align-items: center;
    color: #fff;

    .el-tabs {
      height: 20px;
      padding: 0;
      margin: 0;
      margin-left: 20px;

      .el-tabs__header {
        height: 20px;
        margin: 0;
      }
    }
  }

  .el-dialog__header {
    // border: 1px solid rgba(216, 216, 216, 0.5);
    padding: 20px 20px 10px 20px;
  }

  .search_div {
    width: 100%;

    .el-input__wrapper {
      width: 177px;
      height: 26px;
      border-radius: 166px 166px 166px 166px;
      border: 1px solid #ffffff;
      background: #222;
      color: #fff;
    }
  }

  .el-button {
    width: 68px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px 4px 4px 4px;

    span {
      font-weight: 400;
      font-size: 12px;
      color: #ff4e6c;
      line-height: 22px;
      text-align: left;
      font-style: normal;
      text-transform: none;
    }
  }

  .flex_out {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
    margin-top: 10px;
  }

  .flex_inner {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-around;
    align-items: center;
  }

  .flex_date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .infinite-list {
    margin-top: 10px !important;
    height: 300px;
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .infinite-list .infinite-list-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    margin: 10px;
  }

  .infinite-list .infinite-list-item + .list-item {
    margin-top: 10px;
    margin: 10px 6px;
  }

  .li_item {
    display: flex;
    align-items: stretch;
    justify-content: space-around !important;
    height: 3.125rem;
    /* background: var(--el-color-primary-light-9); */
    margin: 10px 0 10px 0 !important;
    align-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-direction: row;
    width: 100%;

    img {
      width: 48px;
      height: 48px;
      border-radius: 50%;
    }

    .name_span {
      font-weight: 400;
      font-size: 14px;
      color: #ffffff;
      line-height: 16px;
      text-align: center;
      font-style: normal;
      text-transform: none;
    }

    .id_span {
      height: 17px;
      font-weight: 400;
      font-size: 12px;
      color: rgba(255, 255, 255, 0.6);
      line-height: 16px;
      text-align: center;
      font-style: normal;
      text-transform: none;
    }
  }

  .el-dialog__footer {
    padding: 10px;
  }
}
</style>
